package com.timberwood.view;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.timberwood.controller.ProductController;
import com.timberwood.model.Products;

@SuppressWarnings("serial")
public class ProductAction extends ActionSupport{
	
	private ProductController productController;
	
	public ProductAction() {
		productController = new ProductController();
	}
	
	
	//action của sản phẩm bán chạy
	private List<Products> salestproducts = null;
	public List<Products> getSalestproducts(){
		return salestproducts;
	}
	public void setSalestproducts(List<Products> salestProducts) {
		this.salestproducts = salestProducts;
	}
	public String getSalestMenuleft(){
		salestproducts = productController.getSalestProducts();
		return SUCCESS;
	}
	public String getSalestProducts(){
		salestproducts = productController.getSalestProducts();
		return SUCCESS;
	}
	
	//action của sản phẩm mới
	private List<Products> newsproducts = null;
	public List<Products> getNewsproducts() {
		return newsproducts;
	}
	public void setNewsproducts(List<Products> newsproducts) {
		this.newsproducts = newsproducts;
	}
	public String getNewsProducts(){
		newsproducts = productController.getNewsProducts();
		return SUCCESS;
	}
	
	


	
}
